package com.jwdemo
{
	public class Vector2
	{
		
		private var _x:Number 	=	0.0 ;
		private var _y:Number 	=	0.0 ;

		public function Vector2(vx:Number = 0.0, vy:Number = 0.0)
		{
			_x	=	vx ;
			_y	=	vy ;
			
		}

		// Constructor for legacy Lua/JS code.
		
		public function Vector2(pos:Object)
		{
			_x	=	pos.x ;
			_y	=	pos.y ;
		}

		public function SetXyzw(vx:Number = 0.0, vy:Number = 0.0, vz:Number = 0.0, vw:Number = 0.0) : void
		{
			_x 	=	vx ;
			_y	=	vy ;
		}
		
		public function X():Number
		{
			return _x ;
		}

		public function Y():Number
		{
			return _y ;
		}
		
		public function SetX(val:Number):void
		{
			_x	=	val ;
		}

		public function SetY(val:Number):void
		{
			_y	=	val ;
		}

	}
}